package com.ideheima.StrJoiner;

import cn.hutool.core.text.StrJoiner;

import java.util.StringJoiner;

public class Test {

    public static void sum(int[]arr){
        StringJoiner sj = new StringJoiner(",","[","]");
        for (int i = 0; i < arr.length; i++) {
            sj.add(arr[i]+"");
        }
        System.out.println(sj);
    }

    public static void main(String[] args) {
        int[]arr = {1,2,3,4,5};
        sum(arr);
        sum1(arr);
    }


    public static void sum1(int[]arr){
        StrJoiner sj = new StrJoiner("_","@","@");
        for (int i = 0; i < arr.length; i++) {
            sj.append(arr[i]+"");
        }
        System.out.println(sj);
    }
}
